<template>
  <div style="justify-content: center;">
    <div class="header" style="width: 100%">
      <div class="title">{{articles[0].title}}</div>
      <div class="count">
        <span>{{articles[0].author}}</span>
        <span>{{articles[0].create_date}}</span>
        <span>阅读{{articles[0].readings}}万</span>
      </div>
    </div>
    <div class="body">
      <div class="text" v-html="articles[0].content">
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "Article",
  data(){
    return{
      articles: [],
      currentPage: 1,
      pageSize: 18
    }
  },
  mounted: function () {
    this.loadText()
  },
  methods: {
    loadText(){
      console.log(this.$route.params)
      this.$axios.get('/getArticleById?id='+this.$route.params.id,).then(resp => {
        if (resp) {
          this.articles = resp.data
        }
      })
    }
  }
}
</script>
<style>
.title {
  font-weight: 600;
  font-size: 20px;
  text-align: center;
}
.count>span{
  padding: 5px;
  color: #99a9bf;
}
</style>